<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>数据上报任务详情</title>
<#include "/common/resource.ftl">
<style>
.info-table{width:100%;}
.info-table .info-lable{text-align: right;white-space: nowrap;font-weight: normal;width: 90px;padding:10px;padding-right: 10px;background: #fafafa;border-right: 1px solid #eee;border-bottom: 1px solid #eee;}
.info-table .info-value{width: auto;padding: 10px;border-bottom: 1px solid #eee;}

#items{
	border-top: 1px solid #eee;
	border-left: 1px solid #eee;
    padding: 5px;
    text-align: center;
}
#items th,#items td{
	border-right: 1px solid #eee;
	border-bottom: 1px solid #eee;
	padding: 5px;
}
</style>
<script type="text/javascript" src="${params.contextPath}/js/moment.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
	<#if params.id??>
	$.ajax({
        type: "GET",
        url: '${params.contextPath}/web/reportTemplate/query.json',
        data: {id: "${params.id}"},
        success: function(resp){
        	var data = resp.data.template;
        	for(var key in data){
        		$("#"+key).html(data[key]);
        	}
        	var inputList = resp.data.inputList;
            if(inputList){
            	var newTr = "";
            	for(var i=0; i<inputList.length; i++){
            		
            		newTr = newTr  
            			+'<tr>'
            			+'<td>'+inputList[i].chName+'</td>'
            			/*+'<td>'+inputList[i].enName+'</td>'*/
            			+'<td>';
            		if(inputList[i].validRule=="not_null"){
            			newTr = newTr + "必填";
            		}
            		if(inputList[i].validRule=="integer"){
            			newTr = newTr + "整数";
            		}
            		if(inputList[i].validRule=="number"){
            			newTr = newTr + "数值（含小数点）";
            		}
            		newTr = newTr  +'</td></tr>' ;
            	}
            	$("#items").append(newTr);
            }
        }
    });
	</#if>
	
});	
</script>
</head>
<body>
	<table class="info-table">
		<tr>
			<td class="info-lable">模板名称</td>
			<td class="info-value" id="name"></td>
		</tr>
		<tr>
			<td class="info-lable">说明</td>
			<td class="info-value" id="remark"></td>
		</tr>
		<tr>
			<td class="info-lable">录入项</td>
			<td class="info-value">
				<table id="items">
		        	<tr>
		        		<th style="width: 200px">录入项标签</th>
		        		<#--<th style="width: 200px">录入项编码</th>-->
		        		<th style="width: 200px">校验规则</th>
		        	</tr>
		        	
		        </table>
	        </td>
		</tr>
	</table>


</body>
</html>
